<template>
  <div class="home">
    <div class="content">

      <div v-for="(item,i) in rooms" :key="i">
        <img :src="item.roomSrc" alt="">
        <span>{{item.roomName}}</span>
      </div>
    </div>
    
  </div>
</template>

<script>

export default {
  name: 'Home',
  data() {
    return {
      rooms: []
    }
  },
  created() {
    // then axios请求数据成功后获取数据的方法
    console.log(this.$route)
    this.$http.get(`/room/list?page=2&type=${this.$route.params.type}`).then(res => {
      console.log(res)
      this.rooms = res.data.data.list;
    })
  }
}
</script>
